package com.gd.demo.feign.consumer.controller;

import com.gd.demo.cloud.provider.api.PaymentFeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class FeignDemoController {

    @Resource
    private PaymentFeignClient paymentFeignClient;

    @GetMapping("/consumer/payment/nacos/{id}")
    public String consumerDemo(@PathVariable("id") Integer id) {
        String result = paymentFeignClient.getPayment(id);
        System.out.println(result);
        return result;
    }
}
